package com.fonton.fonton.springboot.starter.configration;

import com.fonton.fonton.springboot.starter.entity.CustomProperties;
import com.fonton.ft.common.entity.Custom;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author RenPu
 * @Date 2023/3/24 17:24
 * @Version 1.0
 * @Description:
 **/

@Configuration
@EnableConfigurationProperties(value = CustomProperties.class)
public class CustomConfgration {

    @Bean
    public Custom getCustom(CustomProperties customProperties){
        Custom custom = new Custom();
        custom.setName(customProperties.getName());
        custom.setAge(customProperties.getAge());
        custom.setAddress(customProperties.getAddress());
        return custom;
    }




}
